package com.yupi.oj.judge.codesandbox;

import com.yupi.oj.judge.codesandbox.model.ExecuteCodeRequest;
import com.yupi.oj.judge.codesandbox.model.ExecuteCodeResponse;
import lombok.extern.slf4j.Slf4j;

/**
 * 静态代理，增加其他功能
 */
@Slf4j
public class CodeSandBoxProxy implements CodeSandBox{
    private CodeSandBox codeSandBox;
    public CodeSandBoxProxy(CodeSandBox codeSandBox){
        this.codeSandBox=codeSandBox;
    }
    @Override
    public ExecuteCodeResponse codeExecute(ExecuteCodeRequest executeCodeRequest) {
        //执行前的逻辑
        ExecuteCodeResponse executeCodeResponse = codeSandBox.codeExecute(executeCodeRequest);
        //执行后的逻辑
        return executeCodeResponse;
    }
}
